﻿using Application.AppService.CPCAppService;
using AutoMapper;
using Domain.Entity;
using Microsoft.AspNetCore.Mvc;

namespace UI.Controllers.Customization_Settings_客户化设置_.Salary_management_setting_薪酬管理设置_
{
	public class CPCSSController : Controller
	{
		private readonly ICPCAppService cPCAppService;
		private readonly IMapper mapper;

		public CPCSSController(ICPCAppService cPCAppService, IMapper mapper)
		{
			this.cPCAppService = cPCAppService;
			this.mapper = mapper;
		}
		public IActionResult Index()
		{
			return View();
		}
		[HttpGet("GetCPCSSAttributeKind")]
		public async Task<IActionResult> GetCPCSSAttributeKind()
		{
			List<CPC> cpc = await cPCAppService.GetCPCAttributeKindAsync("薪酬设置");
			return Json(cpc);
		}

		[HttpPost("DeleteCPCSS")]
		public async Task<IActionResult> DeleteCPCSS(int id)
		{
			bool i = await cPCAppService.DeleteCPCAsync(id);
			return Json(i);
		}
		[HttpPost("AddCPCSS")]
		public async Task<IActionResult> AddCPCSS(CPC cpc)
		{
			bool i = await cPCAppService.AddCPCAstnc(cpc);
			return Json(i);
		}
	}
}
